import type { Metadata } from 'next';
import { Geist, Geist_Mono } from 'next/font/google';
import './globals.css';
import Header from '@/components/Header';
import Container from '@/components/Container';

const geistSans = Geist({
  variable: '--font-geist-sans',
  subsets: ['latin'],
});

const geistMono = Geist_Mono({
  variable: '--font-geist-mono',
  subsets: ['latin'],
});

export const metadata: Metadata = {
  title: {
    default: '吃什么 - 随机午餐决策工具',
    template: '%s | 吃什么',
  },
  description: '轻量级午餐决策工具：支持完全随机与反向筛选模式，帮助您快速决定吃什么',
  keywords: ['吃什么', '午餐决策', '随机选择', '饮食推荐', '餐厅推荐'],
  authors: [{ name: 'What to Eat App' }],
  creator: 'What to Eat App',
  publisher: 'What to Eat App',
  openGraph: {
    type: 'website',
    locale: 'zh_CN',
    url: 'https://what-to-eat.example.com',
    title: '吃什么 - 随机午餐决策工具',
    description: '轻量级午餐决策工具：支持完全随机与反向筛选模式，帮助您快速决定吃什么',
    siteName: '吃什么',
  },
  twitter: {
    card: 'summary_large_image',
    title: '吃什么 - 随机午餐决策工具',
    description: '轻量级午餐决策工具：支持完全随机与反向筛选模式，帮助您快速决定吃什么',
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      'max-video-preview': -1,
      'max-image-preview': 'large',
      'max-snippet': -1,
    },
  },
  verification: {
    google: 'google-site-verification-token',
    yandex: 'yandex-verification-token',
  },
  alternates: {
    canonical: 'https://what-to-eat.example.com',
  },
  icons: {
    icon: '/favicon.ico',
    shortcut: '/favicon-16x16.png',
    apple: '/apple-touch-icon.png',
  },
  manifest: '/site.webmanifest',
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="zh-CN">
      <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
        <Header />
        <main>
          <Container>{children}</Container>
        </main>
      </body>
    </html>
  );
}
